package com.dragon.flow.enm.error;

/**
 * @title: 服务请求错误日志类型
 * @author: bruce.liu
 * @since: 2024/4/11 15:19
 */
public enum ServiceErrorTypeEnm {
    SC("sc", "微服务"),
    REST("rest", "rest"),
    HTTP("http", "http"),
    MQ("mq", "MQ");
    private String type;
    private String name;

    ServiceErrorTypeEnm(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static ServiceErrorTypeEnm getByType(String type) {
        for (ServiceErrorTypeEnm e : ServiceErrorTypeEnm.values()) {
            if (e.type.equals(type)) {
                return e;
            }
        }
        return null;
    }
}
